<include file="Public:header" />
<div class="page-member subpage">
    <div class="form-header">
        <div>
            <div class="line1">
                <div class="fl"><h3>{$title}列表</h3></div>
                <div class="fr">
                    <form class="search-form" method="post" action="">
                        <span>查询条件:</span>
                        <select name="field">
                            <option value="no" <if condition="$filter.field eq 'no'">selected="selected"</if>>申请编号</option>
                            <option value="period" <if condition="$filter.field eq 'period'">selected="selected"</if>>申请季度</option>
                            <option value="name" <if condition="$filter.field eq 'name'">selected="selected"</if>>姓名</option>
                            <option value="idno" <if condition="$filter.field eq 'idno'">selected="selected"</if>>身份证号</option>
                            <option value="phone" <if condition="$filter.field eq 'phone'">selected="selected"</if>>家庭移动电话</option>
                        </select>
                        <input name="value" value="{$filter.value}" type="text" placeholder="输入关键字按回车" />
                        <input name="state" value="{$filter.state}" type="hidden" />
                        <input name="page" value="{$filter.page}" type="hidden" />
                        <input name="order_field" value="{$filter.order_field}" type="hidden" />
                        <input name="order_sort" value="{$filter.order_sort}" type="hidden" />
                        <input name="where" value='{$filter.where}' type="hidden" />
                        <button class="btn-normal" type="submit">查 询</button>
                    </form>
                </div>
            </div>
            <div class="line2">
                <div class="fl form-btn-group">
                    <if condition="$filter.state eq 'pass4'">
                    <button onclick="showDialog('ffbtDlg')" class="btn-create btn-highlight">批量发放补贴</button>
                        <else />
                    <button disabled="disabled" class="btn-create btn-disable">新 建</button>
                    </if>
                </div>
                <div class="fl form-btn-more">
                    <button class="btn-normal btn-more">更多操作<i class="drop-down"></i></button>
                    <ul class="more-action hidden">
                        <if condition="$filter.state eq 'submit'">
                            <in name="$x|default='01-03-11'" value="$rightsCode">
                                <li><a onclick="action_del();" href="javascript:void(0);">删 除</a></li>
                            </in>
                        </if>
                        <if condition="$filter.state eq 'pass3'">
                            <li><a onclick="action_export('gsmd2');" href="javascript:void(0)">导出公示名单</a></li>
                        </if>
                        <if condition="$filter.state eq 'pass4'">
                            <li><a onclick="action_cal();" href="javascript:void(0);">计算补贴金额</a></li>
                            <li><a onclick="action_export('gsmd3');" href="javascript:void(0)">导出补贴名单</a></li>
                        </if>
                    </ul>
                </div>
                <div class="fr form-search-count">
                    <span class="offset">({$page.from}-{$page.to})</span>
                    <span class="total">共{$page.total}条</span>
                    <button onclick="PageJump({$page.prevPage});" class="btn-normal">上一页</button>
                    <button onclick="PageJump({$page.nextPage});" class="btn-normal">下一页</button>
                </div>
            </div>
        </div>
    </div>
    <div class="scroll-box" style="z-index:-1;">
        <div class="scroll-table">
            <!--If you don't need header background color you don't need this div.-->
            <div class="header-hack"></div>
            <div class="thead">
                <div class="thead-line">
                    <div class="checkbox"><input name="select-all" type="checkbox" />&nbsp;</div>
                    <div class="list-header" sort="{$filter.order_sort}" field="no">
                        申请编号<if condition="$filter.order_field eq 'no'"><i class="icon-{$filter.order_sort}"></i></if>
                    </div>
                    <div field="state">申请状态</div>
                    <div field="period">申请季度</div>
                    <div field="amount">补贴金额</div>
                    <div class="list-header" sort="{$filter.order_sort}" field="name">
                        姓名<if condition="$filter.order_field eq 'name'"><i class="icon-{$filter.order_sort}"></i></if>
                    </div>
                    <div class="list-header" sort="{$filter.order_sort}" field="idno">
                        身份证号<if condition="$filter.order_field eq 'idno'"><i class="icon-{$filter.order_sort}"></i></if>
                    </div>
                    <div field="gender"><span>性别</span></div>
                    <div field="marriage"><span>婚姻状况</span></div>
                    <div field="dibaork"><span>低保人口</span></div>
                    <div field="dibao"><span>享受低保？</span></div>
                    <div field="dibaohm"><span>低保证号</span></div>
                    <div field="area_id"><span>所在社区和党委口</span></div>
                    <div field="addr"><span>居住地址</span></div>
                    <div field="phone"><span>家庭移动电话</span></div>
                    <div field="attr"><span>家庭属性</span></div>
                    <div field="hujidi"><span>户籍地</span></div>
                    <div field="hujiqk"><span>户籍情况</span></div>
                    <div class="list-header" sort="{$filter.order_sort}" field="gxincome">
                        工薪收入<if condition="$filter.order_field eq 'gxincome'"><i class="icon-{$filter.order_sort}"></i></if>
                    </div>
                    <div class="list-header" sort="{$filter.order_sort}" field="ccincome">
                        财产性收入<if condition="$filter.order_field eq 'ccincome'"><i class="icon-{$filter.order_sort}"></i></if>
                    </div>
                    <div class="list-header" sort="{$filter.order_sort}" field="income">
                        共计收入<if condition="$filter.order_field eq 'income'"><i class="icon-{$filter.order_sort}"></i></if>
                    </div>
                    <div class="list-header" sort="{$filter.order_sort}" field="stime">
                        申请时间<if condition="$filter.order_field eq 'stime'"><i class="icon-{$filter.order_sort}"></i></if>
                    </div>
                    <div field="remarks"><span>备注</span></div>
                </div>
            </div>
            <div class="tbody">
                <volist name="list" id="vo" key="index">
                    <if condition='($filter.state eq accept) and ($vo.lhsp eq 1)'>
                        <div class="tbody-line highlight" offset="{$vo.offset}" data-id="{$vo.id}">
                        <else/>
                        <div class="tbody-line" offset="{$vo.offset}" data-id="{$vo.id}">
                    </if>
                        <div class="checkbox"><input name="checkbox" data-id="{$vo.id}" type="checkbox" />&nbsp;</div>
                        <div field="no">{$vo.no}</div>
                        <div field="state">{$status[$vo[state]]}</div>
                        <div field="period">{$vo.period}</div>
                        <div field="amount">{$vo.amount}</div>
                        <div field="name">{$vo.name}</div>
                        <div field="idno">{$vo.idno}</div>
                        <div field="gender">{$vo.gender}</div>
                        <div field="marriage">{$vo.marriage}</div>
                        <div field="dibaork">{$vo.dibaork}</div>
                        <div field="dibao">{$vo.dibao}</div>
                        <div field="dibaohm">{$vo.dibaohm}</div>
                        <div field="area_id">{$area[$vo[area_id]]}</div>
                        <div class="tl" field="addr">{$vo.addr}</div>
                        <div field="phone">{$vo.phone}</div>
                        <div field="attr">{$vo.attr}</div>
                        <div class="tl" field="hujidi">{$vo.hujidi}</div>
                        <div field="hujiqk">{$vo.hujiqk}</div>
                        <div class="tr" field="gxincome">{$vo.gxincome}</div>
                        <div class="tr" field="ccincome">{$vo.ccincome}</div>
                        <div class="tr" field="income">{$vo.income}</div>
                        <div field="stime">{$vo.stime|date="Y-m-d",###}</div>
                        <div class="tl" field="remarks">{$vo.remarks}</div>
                    </div>
                </volist>
            </div>
        </div>
    </div>
</div>
<div class="dialog ffbtDlg hidden">
    <div class="box" style="height: 240px;">
        <div class="title">
            <h4 class="fl">发放补贴对话框</h4>
            <span class="fr"><a href="#" onclick="closeDialog();">关闭</a></span>
        </div>
        <table class="form-tab">
            <tr>
                <th width="80">发放数量：</th>
                <td>
                    <input value="0" disabled="disabled" name="zlbt-num" type="text" />
                </td>
            </tr>
            <tr>
                <th></th>
                <td>
                    <input type="checkbox" checked="checked" id="sendMsg" />
                    <label>同时发送补贴发放通知短信给申请人</label>
                </td>
            </tr>
            <tr>
                <td colspan="2" style="text-align: center;line-height:40px;">
                    <button class="btn btn-highlight" onclick="action_ffbt();">提交</button>
                    <span>或</span>
                    <a href="#" onclick="closeDialog();" class="linkBtn">放弃</a>
                </td>
            </tr>
        </table>
    </div>
</div>
<script>

    /* 发放补贴 */
    function action_ffbt(){
        var sendMsg = false;
        if($('#sendMsg').is(':checked')) {
            sendMsg = true;
        }
        var dataIds = new Array();
        $("input[name=checkbox]").each(function(){ //由于复选框一般选中的是多个,所以可以循环输出
            if($(this).is(":checked")){
                dataIds.push( parseInt($(this).attr("data-id")));
            }
        });
        if(dataIds.length==0){
            alert("请选择要计算的对象");
            return false;
        }
        $.ajax({
            url:"/admin/zlbt/ajax_ffbt",
            data: {info:dataIds, sendMsg:sendMsg}, type:"POST", dataType:"JSON",
            success: function(data){
                if(data.status){
                    alert("补贴发放成功");
                    location.reload();
                }else{
                    console.log(data.info);
                    alert(data.info);
                }
            }
        });
    }

    $(".scroll-table .tbody").scroll(function(){
        $(".scroll-table .thead").scrollLeft($(this).scrollLeft());
    });
</script>
<script src="__JS__/zlbt.js?v=0.2" type="text/javascript" ></script>
<include file="Public:footer" />

